<!DOCTYPE HTML>
<html>
<head>
    <title><?php echo $title_for_layout; ?></title>
    <script type="text/javascript"><!--//--><![CDATA[//><!--
        var userid = '<?php echo USERID; ?>'; var controller = null; var action = null; var gs_localize = '<?php echo $culture; ?>'; var gs_path = '<?php echo base_url(); ?>'; if (gs_path.substr((gs_path.length - 1), 1) == '/') { gs_path = gs_path.substr(0, gs_path.length - 1); } var now = new Date(<?php echo @date("Y", strtotime($time_adjust)); ?>, <?php echo (intval(@date("m", strtotime($time_adjust))) - 1); ?>, <?php echo @date("d", strtotime($time_adjust)); ?>, <?php echo @date("H", strtotime($time_adjust)); ?>, <?php echo @date("i", strtotime($time_adjust)); ?>, <?php echo @date("s", strtotime($time_adjust)); ?>); var gs_app = '<?php echo base64_encode($sessid); ?>'; var sessid = null; var debug = null;
		var gs_msg_row_unselected = 'Please Select Row';
    //--><!]]></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>content/js/jquery-1.7.1.min.js"></script>
    <!--<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=AIzaSyAZoD4owvDnzCRGVWDLgRxuWY1k4saR60g&sensor=true"></script>-->
    <script type="text/javascript" src="<?php echo base_url(); ?>content/js/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>content/js/jquery-ui-1.8.18.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>content/js/fg.menu.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>vendor/tiny_mce/tiny_mce.js"></script>
    <script type='text/javascript' src='<?php echo base_url(); ?>vendor/tinymce-thumbnail-gallery/includes/colorbox/jquery.colorbox-min.js'></script>
    
     <script type="text/javascript" src="<?php echo base_url(); ?>vendor/highcharts/highcharts.js"></script>
    <?php /*<script type="text/javascript" src="<?php echo base_url(); ?>vendor/highcharts/modules/exporting.js"></script>*/ ?>
    
    <?php /*<script type="text/javascript" src="<?php echo base_url(); ?>content/js/jquery.flot.min.js"></script>
    <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="<?php echo base_url(); ?>content/js/excanvas.min.js"></script><![endif]-->
    <script type="text/javascript" src="<?php echo base_url(); ?>content/js/jquery.flot.crosshair.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>content/js/jquery.flot.pie.min.js"></script>*/ ?>

    <script type="text/javascript" src="<?php echo base_url(); ?>content/js/jquery.tipTip.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>content/js/jquery.zeke.js"></script>
    
	<script type="text/javascript" src="<?php echo base_url(); ?>content/js/datagrid-detailview.js"></script>
	
    <script type="text/javascript" src="<?php echo base_url(); ?>content/js/global.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>content/js/lov.core.js"></script>
	<?php if(defined('APP') && APP != 'CORE'){ ?>
    <script type="text/javascript" src="<?php echo base_url(); ?>content/js/lov.<?php echo strtolower(APP); ?>.js"></script>
    <?php } ?>
    <link rel="shortcut icon" href="<?php echo base_url(); ?>content/images/favicon.ico" />
    <link href="<?php echo base_url(); ?>content/css/fg.menu.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo base_url(); ?>content/css/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo base_url(); ?>content/css/gray/easyui.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo base_url(); ?>content/css/icon.css" rel="stylesheet" type="text/css" />
    
    <link href="<?php echo base_url(); ?>content/css/tipTip.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo base_url(); ?>content/css/admin.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo base_url(); ?>vendor/tinymce-thumbnail-gallery/includes/colorbox/colorbox.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
	.menu_hidden { position:absolute; top:0; left:-9999px; width:1px; height:1px; overflow:hidden; }
	.fg-button.ui-state-loading .ui-icon { background: url(spinner_bar.gif) no-repeat 0 0; }
	#list_module .tree li > div{ padding:4px 3px; margin:0px; }
	#list_module .tree li > div.tree-node-hover{ background-color:#f4fafd; }
	#list_module .tree li > div.tree-node-selected{ background-color:#D6EFFC; }
	#cont_clock{ font-weight:normal; margin-top:5px; }
	</style>
	<!-- style exceptions for IE 6 -->
	<!--[if IE]>
	<style type="text/css">
		.fg-menu-ipod .fg-menu li { width: 95%; }
		.fg-menu-ipod .ui-widget-content { border:0; }
	</style>
	<![endif]-->
</head>
<body class="easyui-layout" style="text-align:left">
    <div id="content_block" style="background-color:#999; filter:alpha(opacity=100); opacity: 1; -moz-opacity: 1;"></div><div id="content_loading" style="display:none;"><img src="<?php echo base_url(); ?>content/images/spinner.gif" /> Loading.. </div><script type="text/javascript">try { var winWidth = document.all ? document.body.clientWidth : window.innerWidth } catch (er) { winWidth = screen.width } try { var winHeight = document.all ? document.body.clientHeight : window.innerHeight } catch (er) { winHeight = screen.height } $('#content_block').css('width', winWidth + 'px').css('height', winHeight + 'px'); var ln_left = (winWidth - 250) / 2; if (ln_left < 0) ln_left = 0; var ln_top = (winHeight - 350) / 2; if (ln_top < 0) ln_top = 0; $('#content_loading').css('left', ln_left + 'px').css('top', ln_top + 'px').hide(); $('#content_loading').show();</script>
    <div id="content_debug" style="display:none;"></div>
    <div id="content_config">
        <input type="checkbox" id="chk_debug" <?php echo ($dev == 1 ? " checked=\"checked\"" : ""); ?> />
    </div>
    
    <div region="north" border="false" style="background:#666;text-align:center; height:83px;">
        <div id="app_header">
            <div class="left">&nbsp;</div>
            <div class="right <?php echo strtolower(APP); ?>">&nbsp;</div>
        </div>
        
        <div id="app_navigation" class="ui-widget-header">
        	<div class="left">
            	<div id="cont_clock"></div>
            </div>
            <div class="right">
                <div class="button_set">
                    <?php echo 'Welcome, '.$arr_session['user_name']; ?>
                    <!--<a id="btn_sysmessage" class="easyui-linkbutton" plain="true" iconCls="icon-mail" title="Mailbox"></a>
                    <?php if($dev == 1) { ?><a id="btn_sysdebug" class="easyui-linkbutton" plain="true" iconCls="icon-bug" title="Debuging Application [Developer Only]"></a><?php } ?>
                    <a id="btn_sysconfig" class="easyui-linkbutton" plain="true" iconCls="icon-gears" title="Configuration"></a>-->
                    <a id="btn_sysuser" class="easyui-linkbutton" plain="true" iconCls="icon-user" title="User Profile"></a>
					<a id="btn_syslogout" class="easyui-linkbutton" plain="true" iconCls="icon-turnoff" title="Logout">Logout</a>
					
                </div>
            </div>
        </div>
        <br clear="all" />
    
    </div>
	
<?php if(isset($arr_app) && is_array($arr_app) && count($arr_app)>1){ ?>
    <div region="west" border="false" split="true" iconCls="icon-menu" title=" &nbsp; &nbsp; <span style=<?php echo htmlspecialchars('"cursor:pointer; display:inline-block; width:150px; margin-left:-15px;"'); ?> onclick=<?php echo htmlspecialchars('"redirect(gs_path+\'/app/select_app\');"'); ?>>Select Application</span> " style="width:250px;padding:0px;">
<?php }else{ ?>
	
	<div region="west" border="false" split="true" iconCls="icon-home" title=" &nbsp; &nbsp; <span style=<?php echo htmlspecialchars('"cursor:pointer; display:inline-block; width:150px; margin-left:-15px;"'); ?> onclick=<?php echo htmlspecialchars('"loadPage(\'/app/dashboard\');"'); ?>>Dashboard</span> " style="width:250px;padding:0px;">

<?php } ?>
    	<div id="list_module" class="easyui-accordion">       
            <?php  
			// First Level Menu
			for($i=0, $max_i=count($arr_firstmenu); $i<$max_i;$i++){
				$row = $arr_firstmenu[$i];
				echo '<div title="' . htmlspecialchars($row['menu_label']).'"'.($row['icon']==''?'':' iconCls="icon-'.$row['icon'].'"').' style="overflow:auto;padding:0px;">';
					echo '<ul id="menu_' . $row['menu_id'] . '" rel="' . $row['menu_id'] . '" class="easyui-tree"></ul>';
				echo '</div>';
			}
		?></div>
        </div>
        <script type="text/javascript">
        	$('#list_module').accordion({ fit:true });
        </script>
        
    <div id="container" region="center" border="false" style="background-color:#E6E9E9">
        <?php if(isset($content_for_layout)) echo $content_for_layout; ?>
	</div>
    
    
    <div id="app_footer" region="south">
        <p class="left">Copyright &copy; 2013 <?php echo $title; ?>.</p>
        <p class="right">Design By <a href="http://gurningsoft.com" target="_new">Gurningsoft</a></p>
    </div>
    <iframe id="if_submit" name="if_submit" style="display:none;"></iframe>
    <iframe id="if_download" name="if_download" style="display:none;"></iframe>
</body>
</html>